package tests
{
	import flexunit.framework.TestCase;
	
	import jui.business.vo.MessageIdVO;
 	
	public class MessageIdVOTest extends TestCase
	{
		// please note that all test methods should start with 'test' and should be public
 		
 		// Reference declaration for class to test
 		private var classToTestRef : jui.business.vo.MessageIdVO;
 		
 		public function MessageIdVOTest(methodName:String=null)
 		{
 			//TODO: implement function
 			super(methodName);
 		}
 		
 		//This method will be called before every test function
 		override public function setUp():void
 		{
 			//TODO: implement function
 			super.setUp();
 		}
 		
 		//This method will be called after every test function
 		override public function tearDown():void
 		{
 			//TODO: implement function
 			super.tearDown();
 		}
 		
 		public function testMessageIdVO():void
 		{
 			// Add your test logic here
 			// fail("Test method Not yet implemented");
			
			// #200400/18
			assertEquals('In "#200400/18", mid = "200400"', ' 200400', new MessageIdVO('#200400/18').mid );
			assertEquals('In "#200400/18", rid = "18"', '18', new MessageIdVO('#200400/18').rid );
			
			// MID Test
			assertTrue('In "1234", mid = "1234"', (new MessageIdVO('1234')).mid == '1234');
			assertTrue('In " 1234", mid = "1234"', (new MessageIdVO(' 1234')).mid == '1234');
			assertTrue('In " #1234", mid = "1234"', (new MessageIdVO(' #1234')).mid == '1234');

			assertTrue('In "1234/", mid = "1234"', (new MessageIdVO('1234/')).mid == '1234');
			assertTrue('In " 1234/", mid = "1234"', (new MessageIdVO(' 1234/')).mid == '1234');
			assertTrue('In " #1234/", mid = "1234"', (new MessageIdVO(' #1234/')).mid == '1234');
			
			assertTrue('In "1234/5", mid = "1234"', (new MessageIdVO('1234/5')).mid == '1234');
			assertTrue('In " 1234/5", mid = "1234"', (new MessageIdVO(' 1234/5')).mid == '1234');
			assertTrue('In " #1234/5", mid = "1234"', (new MessageIdVO(' #1234/5')).mid == '1234');

				// Spaces at the end
				assertTrue('In "1234 ", mid = "1234"', (new MessageIdVO('1234 ')).mid == '1234');
				assertTrue('In " 1234 ", mid = "1234"', (new MessageIdVO(' 1234 ')).mid == '1234');
				assertTrue('In " #1234 ", mid = "1234"', (new MessageIdVO(' #1234 ')).mid == '1234');
	
				assertTrue('In "1234/ ", mid = "1234"', (new MessageIdVO('1234/ ')).mid == '1234');
				assertTrue('In " 1234/ ", mid = "1234"', (new MessageIdVO(' 1234/ ')).mid == '1234');
				assertTrue('In " #1234/ ", mid = "1234"', (new MessageIdVO(' #1234/ ')).mid == '1234');
				
				assertTrue('In "1234/5 ", mid = "1234"', (new MessageIdVO('1234/5 ')).mid == '1234');
				assertTrue('In " 1234/5 ", mid = "1234"', (new MessageIdVO(' 1234/5 ')).mid == '1234');
				assertTrue('In " #1234/5 ", mid = "1234"', (new MessageIdVO(' #1234/5 ')).mid == '1234');

			// RID Test
			assertTrue('In "1234", rid = ""', (new MessageIdVO('1234')).rid == '');
			assertTrue('In " 1234", rid = ""', (new MessageIdVO(' 1234')).rid == '');
			assertTrue('In " #1234", rid = ""', (new MessageIdVO(' #1234')).rid == '');

			assertTrue('In "1234/", rid = ""', (new MessageIdVO('1234/')).rid == '');
			assertTrue('In " 1234/", rid = ""', (new MessageIdVO(' 1234/')).rid == '');
			assertTrue('In " #1234/", rid = ""', (new MessageIdVO(' #1234/')).rid == '');
			
			assertTrue('In "1234/5", rid = "5"', (new MessageIdVO('1234/5')).rid == '5');
			assertTrue('In " 1234/5", rid = "5"', (new MessageIdVO(' 1234/5')).rid == '5');
			assertTrue('In " #1234/5", rid = "5"', (new MessageIdVO(' #1234/5')).rid == '5');

				// Spaces at the end
				assertTrue('In "1234 ", rid = ""', (new MessageIdVO('1234 ')).rid == '');
				assertTrue('In " 1234 ", rid = ""', (new MessageIdVO(' 1234 ')).rid == '');
				assertTrue('In " #1234 ", rid = ""', (new MessageIdVO(' #1234 ')).rid == '');
	
				assertTrue('In "1234/ ", rid = ""', (new MessageIdVO('1234/ ')).rid == '');
				assertTrue('In " 1234/ ", rid = ""', (new MessageIdVO(' 1234/ ')).rid == '');
				assertTrue('In " #1234/ ", rid = ""', (new MessageIdVO(' #1234/ ')).rid == '');
				
				assertTrue('In "1234/5 ", rid = "5"', (new MessageIdVO('1234/5 ')).rid == '5');
				assertTrue('In " 1234/5 ", rid = "5"', (new MessageIdVO(' 1234/5 ')).rid == '5');
				assertTrue('In " #1234/5 ", rid = "5"', (new MessageIdVO(' #1234/5 ')).rid == '5');
 		}
	}
}